package com.promise.jokerdream.ui.settings

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.clickable
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import com.promise.jokerdream.database.entity.PenguinFightGameConfigEntity
import com.promise.jokerdream.ui.components.CheckboxOptionRow
import com.promise.jokerdream.ui.components.SettingCard
import com.promise.jokerdream.ui.components.RoundCheckbox
import com.promise.jokerdream.ui.theme.AppSpacing
import com.promise.jokerdream.ui.theme.AppFontSizes

/**
 * 企鹅大战设置卡片
 */
@Composable
fun PenguinFightSettingCard(
    config: PenguinFightGameConfigEntity,
    onPenguinFightChange: (Boolean) -> Unit,
    onBossChange: (Boolean) -> Unit,
    onXialvChange: (Boolean) -> Unit,
    onShituChange: (Boolean) -> Unit,
    onJiebaiChange: (Boolean) -> Unit,
    modifier: Modifier = Modifier,
    onExecuteClick: (() -> Unit)? = null
) {
    SettingCard(
        title = "乐斗",
        description = "",
        checked = config.enabledSetting,
        onCheckedChange = onPenguinFightChange,
        modifier = modifier,
        onExecuteClick = onExecuteClick,
        content = {
            if (config.enabledSetting) {
                Column(
                    modifier = Modifier.fillMaxWidth()
                ) {
                    // Boss 选项
                    CheckboxOptionRow(
                        title = "挑战Boss",
                        checked = config.bossEnabled,
                        onCheckedChange = onBossChange
                    )

                    // 侠侣选项
                    CheckboxOptionRow(
                        title = "侠侣乐斗",
                        checked = config.marryEnabled,
                        onCheckedChange = onXialvChange
                    )

                    // 师徒选项
                    CheckboxOptionRow(
                        title = "师徒乐斗",
                        checked = config.shituEnabled,
                        onCheckedChange = onShituChange
                    )

                    // 结拜选项
                    CheckboxOptionRow(
                        title = "结拜乐斗",
                        checked = config.brotherEnabled,
                        onCheckedChange = onJiebaiChange
                    )
                }
            }
        }
    )
}